# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=tcpflow
pkgver=1.5.0
pkgrel=3
pkgdesc="A Tool for monitoring, capturing and storing TCP connections flows"
url="https://github.com/simsong/tcpflow"
arch="all"
license="GPL-3.0-only"
makedepends="libpcap-dev zlib-dev boost-dev openssl-dev autoconf automake"
subpackages="$pkgname-doc"
source="https://fossies.org/linux/misc/tcpflow-$pkgver.tar.gz
	CVE-2018-18409.patch
	"

# secfixes:
#   1.5.2-r1:
#     - CVE-2018-18409


prepare() {
	default_prepare
	sed -i 's/test-pdfs.sh//' tests/Makefile.am
	autoreconf -fsiv
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man

	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="eaf518e5e4d95ea9587542cec16a65a8e1518b54e6c23d84355ce11780c99758346db364ba502f90d938e54b01a1e32807d69ed35afb1e5e378a9a009c5609f5  tcpflow-1.5.0.tar.gz
104ffc29954da657d52881491ed8f3102123f8ed36fbd8f435ffa24d05fe2ef7c34d84b16477c1408bac935497499d8550fec81ffaa84b9b783d09f4b6bab428  CVE-2018-18409.patch"
